home *** CD-ROM | disk | FTP | other *** search
Wrap
// Namo WebEditor action script // 5.1 function na_change_img_src(name, nsdoc, rpath, preload) // Replace Image // img, a, layer, button, timeline // 'Original image name' IMG, '' NSDOC, 'Replacement image path' FILE gif, 'Preload replacement image' PRELOADBOOL // Swaps one image for another by changing the SRC attribute of the IMG tag. { var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name); if (name == '') return; if (img) { img.altsrc = img.src; img.src = rpath; } } function na_restore_img_src(name, nsdoc) // Restore Image // img, a, layer, button, timeline // 'Image name' IMG, '' NSDOC // Restores the last set of swapped images to their previous source files. { var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name); if (name == '') return; if (img && img.altsrc) { img.src = img.altsrc; img.altsrc = null; } } function na_call(str) // Call JavaScript Function // body, img, a, select, text, button, file, textarea, timeline, layer // 'Function' TEXT // Calls the JavaScript Function you specify. { eval(str); } function na_check_browser(nsurl, otherurl, framestr) // Redirect by Browser // body, img, a, select, button, timeline // 'Netscape URL' FILE htm html, 'Explorer URL' FILE htm html, 'Target Frame' FRAME // Redirects the visitor according to the browser type. { var url = (navigator.appName.indexOf('Netscape', 0) != -1) ? nsurl : otherurl; if (framestr == 'blank') { window.open(url, 'win1'); } else { var frameobj = eval(framestr); frameobj.location = url; } } function na_check_plugin(plugin, pnsurl, nsurl, framestr) // Check Plugin Installation // body, img, a, select, button, timeline // 'Plugin name' TEXT 'Shockwave Flash', 'Plugin exists URL' TEXT http://, 'No plugin URL' TEXT http://, 'Target frame' FRAME // Checks if the specific plugin is installed, and redirects the visitor accordingly (Netscape Navigator Compatible). { var url; if (navigator.plugins && navigator.plugins[plugin]) url = pnsurl; else url = nsurl ; if (framestr == 'blank') { window.open(url, 'win1'); } else { var frameobj = eval(framestr); frameobj.location = url; } } function na_show_layer(lname) // Show Layer // img, a, layer, select, button, timeline // 'Target layer' LAYER // Shows layer. { if (lname == '') return; var layer = document.all ? document.all(lname).style : document.layers[lname]; var show = document.all ? 'visible' : 'show'; var hide = document.all ? 'hidden' : 'hide'; if (na_show_layer.arguments.length <= 1) layer.visibility = show; else layer.visibility = (na_show_layer.arguments[1] == 0 ? show : hide); } function na_hide_layer(lname) // Hide Layer // img, a, layer, select, button, timeline // 'Target layer' LAYER // Hides layer. { if (document.layers) document.layers[lname].visibility = 'hide' if(document.all) document.all(lname).style.visibility = 'hidden' } function na_alert(str) // Popup Message // body, img, a, select, button, timeline // 'Message text' TEXT // Shows a message in a pop up window. { alert(str); } function na_preload_img() // Preload Image // body // '' CONST true, 'Image path' FILE // Loads the image when the window opens, even if it's not called. { var img_list = na_preload_img.arguments; if (document.preloadlist == null) document.preloadlist = new Array(); var top = document.preloadlist.length; for (var i=0; i < img_list.length; i++) { document.preloadlist[top+i] = new Image; document.preloadlist[top+i].src = img_list[i+1]; } } function na_open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable) // Open URL // body, img, a, button, layer, timeline // 'Window name' TEXT win1, 'URL' FILE htm html, 'X coordinate' NUM 100 0 2000, 'Y coordinate' NUM 100 0 2000, 'Width' NUM 300 100 10000, 'Height' NUM 200 50 10000, 'Show toolbar' NUMCOMBO No Yes, 'Show menu bar' NUMCOMBO No Yes, 'Show status bar' NUMCOMBO No Yes, 'Show scroll bars' NUMCOMBO No Yes, 'Resizable' NUMCOMBO No Yes // Opens a URL in a new window. { toolbar_str = toolbar ? 'yes' : 'no'; menubar_str = menubar ? 'yes' : 'no'; statusbar_str = statusbar ? 'yes' : 'no'; scrollbar_str = scrollbar ? 'yes' : 'no'; resizable_str = resizable ? 'yes' : 'no'; window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str); } function na_set_status_msg(msg) // Insert Text in Status Bar // body, img, a, button, layer, timeline // 'Message text' TEXT // Shows a message in the status bar. { status = msg; } function na_tm_gotoframe(name, frame, count, gotoID) // Go to Time Line Frame // body, img, a, button, layer, timeline // 'Time Line name' TIMELINE, 'Frame number' NUM 1 1 1000, 'Limit of repetitions' NUM 1 -1 100000, '' IDSTRING // Plays a Time Line beginning at the specified frame. { var tm, bar, layer, prop_tbl, prop_name, prop_value, n_bar, n_prop; var frame, nkeyfrm, startfrm, endfrm, f, kf, i, j, back; var ns = navigator.appName.indexOf('Netscape', 0) != -1; if (document.NamoTime == null) NamoTime_Init(); if ((tm = document.NamoTime[name]) == null) return; if (tm.gotoCount == null) tm.gotoCount = new Array(10); if (tm.gotoCount[gotoID] == null) tm.gotoCount[gotoID] = count; if (tm.gotoCount[gotoID] == 0) return; if (tm.gotoCount[gotoID] > 0) tm.gotoCount[gotoID]--; if (tm.actions) { for (i=0; i < tm.actions[0].length && tm.actions[0][i] <= frame; i++) if (tm.actions[0][i] == frame) eval(tm.actions[1][i]); } back = (frame < tm.curframe); n_bar = tm.length; for (i=0; i < n_bar; i++) { if ((bar = tm[back ? n_bar-1-i : i]) == null) continue; nkeyfrm = bar.keyframes.length; startfrm = bar.keyframes[0]; endfrm = bar.keyframes[nkeyfrm-1]; if ((back == false && frame < startfrm) || (back && frame > endfrm)) continue; f = Math.min(Math.max(0, frame - startfrm), endfrm); for (kf=j=0; j < bar.keyframes.length-1 && bar.keyframes[j] <= frame; kf = j++) ; if (bar.props == null) continue; n_prop = bar.props.length; layer = bar.layer; if (layer == null) continue; for (j=0; j < n_prop; j++) { prop_tbl = bar.props[j]; prop_name = prop_tbl.prop; prop_value = prop_tbl[(bar.keyframes.length < prop_tbl.length) ? f : kf]; if (ns) layer[prop_name] = prop_value; else layer.style[prop_name] = prop_value; } } if (tm.curframe == 0 || tm.pause) setTimeout('NamoTime_Play(\''+name+'\')', tm.delay); tm.curframe = frame; } function na_tm_play(name) // Play Time Line // body, img, a, button, layer, timeline // 'Time Line name' TIMELINE // Plays a Time Line. { var tm; if (document.NamoTime == null) NamoTime_Init(); if ((tm = document.NamoTime[name]) == null) return; if (tm.curframe == 0 || tm.pause) setTimeout('NamoTime_Play(\''+name+'\')', tm.delay); tm.pause = false; } function na_tm_pause(name) // Stop Time Line // body, img, a, button, layer, timeline // 'Time Line name' TIMELINE // Stops a Time Line. { var tm; if (document.NamoTime == null) NamoTime_Init(); if ((tm = document.NamoTime[name]) == null) return; tm.pause = true; } function na_move_layer(lname, x, y) // Move Layer to // img, a, select, layer // 'Target Layer' LAYER, 'X Coordinate' NUM 100, 'Y Coordinate' NUM 100 // Moves layer to the position you specify. { if (document.layers) document.layers[lname].moveTo(x,y) if (document.all) document.all(lname).style.pixelTop=y document.all(lname).style.pixelLeft=x if (document.getElementById) document.getElementById(lname).style.pixelTop=y document.getElementById(lname).style.pixelLeft=x } function na_move_by_layer(lname, offsetx, offsety) // Move Layer by // a, img, select, layer // 'Target Layer' LAYER, 'Offset X' NUM 10, 'Offset Y' NUM 10 // Moves layer by the amount of offset you specify. { if (document.getElementById) { var oj = document.getElementById(lname).style oj.left = parseInt(oj.left) + offsetx oj.top = parseInt(oj.top) + offsety } else if (document.layers) document.layers[lname].moveBy(offsetx,offsety) else if (document.all) { var oj = document.all(lname).style oj.pixelLeft += offsetx oj.pixelTop += offsety } } function na_slide_layers(lname, startX, startY, endX, endY, speed, stpx) { // Glide Layer // a, img, select, layer // 'Target Layer' LAYER, 'Start X' NUM, 'Start Y' NUM, 'End X' NUM, 'End Y' NUM, 'Speed' NUM 10, 'Step' NUM 10 // Moves layer to a user-specified position at the speed you desire. if (! document.count) { document.wx = new Array(); document.wy = new Array(); document.ex = new Array(); document.ey = new Array(); document.spd = new Array(); document.step = new Array(); document.stepX = new Array(); document.stepY = new Array(); document.mvFlag = new Array(); document.slideID = new Array(); document.count = new Array(); } if (!document.mvFlag[lname]) { clearTimeout(document.slideID[lname]); document.count[lname] = 0; var ofX = (endX - startX); var ofY = (endY - startY); document.step[lname] = Math.max(Math.abs(ofX), Math.abs(ofY))/stpx ; document.stepX[lname] = ofX/document.step[lname]; document.stepY[lname] = ofY/document.step[lname]; document.wx[lname] = startX; document.wy[lname] = startY; document.ex[lname] = endX; document.ey[lname] = endY; document.spd[lname] = speed; document.mvFlag[lname] = true; } if (document.mvFlag[lname] && (document.count[lname] <= document.step[lname]-1)){ document.count[lname]++ document.wx[lname] += document.stepX[lname]; document.wy[lname] += document.stepY[lname]; clearTimeout(document.slideID[lname]); document.slideID[lname] = setTimeout('na_slide_layers("'+lname+'")', document.spd[lname]); } else { document.wx[lname] = document.ex[lname]; document.wy[lname] = document.ey[lname]; clearTimeout(document.slideID[lname]); document.mvFlag[lname] = false; } if (document.layers) document.layers[lname].moveTo(document.wx[lname],document.wy[lname]); if (document.all) document.all(lname).style.posLeft = document.wx[lname]; if (document.all) document.all(lname).style.posTop = document.wy[lname]; } function na_set_clip (lname, clipTop, clipLeft, clipRight, clipBottom) // Clip Layer // body, img, a, select, button, timeline, layer // 'Target Layer' LAYER, 'Top' NUM, 'Left' NUM, 'Right' NUM, 'Bottom' NUM // Clips off a portion of layer. Specify 4 lines that trims off the layer. { if (document.layers) { with(document.layers[lname].clip) { top = clipTop; right = clipRight; bottom = clipBottom; left = clipLeft } } if (document.all) document.all(lname).style.clip = 'rect('+clipTop+','+clipRight+','+clipBottom+','+clipLeft+')' } function na_zindex_layer(lname, zindex) // Set Z-Index // img, a, select, button, timeline, layer // 'Target Layer' LAYER, 'Z-Index' NUM 1 // Set Z-Index, which decides the stacking row of layers. Higher the number, upper it's placed. { if (document.layers) document.layers[lname].zIndex = zindex if (document.all) document.all(lname).style.zIndex = zindex if (document.getElementById) document.getElementById(lname).style.zIndex = zindex } function na_set_bgcolor_layer(lname, color) // Set Background Color of Layer // img, a, select, button, timeline, layer // 'Target Layer' LAYER, 'Color' COLOR #FFFFFF // Sets the background color of the layer. { if (document.layers) document.layers[lname].bgColor = color if (document.all) document.all(lname).style.backgroundColor = color if (document.getElementById) document.getElementById(lname).style.backgroundColor = color } function na_set_background_image_layer(lname, src) // Set Background Image of Layer // img, a, select, button, timeline, layer // 'Target Layer' LAYER, 'Image' FILE // Changes the background image of a layer. { ns4 = (document.layers)? true:false ie4 = (document.all)? true:false ns6 = (document.getElementById)? true:false if (ns4) document.layers[lname].background.src = src; if (document.all) document.all(lname).style.backgroundImage = "url(" + src + ")"; if (ns6) document.getElementById(lname).style.backgroundImage = "url(" + src + ")"; } function na_write_to_layer(lname, str, color, size, font, style, weight) // Insert Text to Layer // img, a, select, button, timeline, layer // 'Target Layer' LAYER, 'Message' TEXT, 'Font Color' COLOR #000000, 'Font Size (pt)' NUM 12, 'Font' FONT, 'Font Style' TEXTCOMBO 'normal' 'italic' 'oblique', 'Font Weight' TEXTCOMBO 'normal' 'bold' 'bolder' 'lighter' 100 200 300 400 500 600 700 800 900 // Inserts text to the designated layer. { if (document.layers) { with(document.layers[lname]) { document.open() document.write(str) document.fgColor = color document.close(); } } if (document.all) { document.all(lname).style.color = color document.all(lname).style.fontSize = size document.all(lname).style.fontFamily = font document.all(lname).style.fontStyle = style document.all(lname).style.fontWeight = weight document.all(lname).innerHTML=str } if (document.getElementById) { document.getElementById(lname).style.color = color document.getElementById(lname).style.fontSize = size document.getElementById(lname).style.fontFamily = font document.getElementById(lname).style.fontStyle = style document.getElementById(lname).style.fontWeight = weight document.getElementById(lname).innerHTML = str } } function na_resize_layer(lname, w, h) // Resize Layer // img, a, select, button, timeline, layer // 'Target Layer' LAYER, 'Width' NUM 200, 'Height' NUM 200 // Resizes a layer to the specified size. { if (document.layers) document.layers[lname].resizeTo(w,h); if (document.all) document.all[lname].style.width = w; document.all[lname].style.height = h; } function na_wipe_clip(lname, stT, stR, stB, stL, color, endT, endR, endB, endL, step) { // Wipe Layer // body, a, img, layer // 'Target Layer' LAYER, 'Starting Top' NUM, 'Starting Right' NUM, 'Starting Bottom' NUM, 'Starting Left' NUM, 'Color' COLOR #000000, 'Ending Top' NUM, 'Ending Right' NUM ,'Ending Bottom' NUM, 'Ending Left' NUM, 'Step' NUM 10 // Makes a crawling effect of a layer. Specify starting/ending rectangles. if (!document.wipIniFlag) { document.wiptID = setTimeout('',1); document.wipIniFlag = false; document.t = stT; document.r = stR; document.b = stB; document.l = stL; stepT=(Math.max(document.t,endT) - Math.min(document.t,endT))/step; stepR=(Math.max(document.r,endR) - Math.min(document.r,endR))/step; stepB=(Math.max(document.b,endB) - Math.min(document.b,endB))/step; stepL=(Math.max(document.l,endL) - Math.min(document.l,endL))/step; clipvalue = document.t+','+document.r+','+document.b+','+document.l+',"' clipvalue += color+'",' clipvalue += endT+','+endR+','+endB+','+endL+','+step if (document.layers) document.layers[lname].bgColor=color; if (document.all) document.all(lname).style.backgroundColor=color; document.wipIniFlag=true; } if (document.t > endT) document.t -= stepT; if (document.r < endR) document.r += stepR; if (document.b < endB) document.b += stepB; if (document.l > endL) document.l -= stepL; if (!(document.t > endT) &&! (document.r < endR) &&! (document.b < endB) &&!(document.l > endL)) { clearTimeout(document.wiptID); } else { document.wiptID=setTimeout('na_wipe_clip("'+lname+'",'+clipvalue+')',10); } if (document.all) { with (document.all(lname).style) { if (pixelWidth < document.r) pixelWidth = document.r; if(pixelHeight < document.b) pixelHeight = document.b; } } if (document.layers) { with(document.layers[lname].clip) { top=document.t; right = document.r; bottom = document.b; left = document.l; } } if (document.all) { document.all(lname).style.clip ='rect('+document.t+','+document.r+','+document.b+','+document.l+')'; } } function na_tooltip_layer(lname, str, bgclor, c_x, c_y, color, font, size, style, weight) // Make Layer Tooltip // img, a // 'Target Layer' LAYER, 'Message' TEXT, 'Background Color' COLOR #FFFFFF, 'Client X' NUM, 'Client Y' NUM, 'Font Color' COLOR #000000, 'Font' FONT, 'Font Size (pt)' NUM 12, 'Font Style' TEXTCOMBO 'normal' 'italic' 'oblique', 'Font Weight' TEXTCOMBO 'normal' 'bold' 'bolder' 'lighter' 100 200 300 400 500 600 700 800 900 // Makes a tooltip that describes the designated layer (Internet Explorer Compatible). { document.all(lname).style.visibility = "visible" ; document.all(lname).style.positionr = "absolute"; document.all(lname).style.left = event.clientX+c_x; document.all(lname).style.top = event.clientY+c_y; document.all(lname).style.color = color; document.all(lname).style.fontSize = size; document.all(lname).style.fontFamily = font; document.all(lname).style.fontStyle = style; document.all(lname).style.fontWeight = weight; document.all(lname).style.backgroundColor = bgclor; document.all(lname).innerHTML = str; } function na_change_image_size(image_name, w, h) // Resize Image // img, a, select, button, layer // 'Image Name' IMG, 'Width' NUM 200, 'Height' NUM 200 // Resizes the image to the size you specify (Internet Explorer Compatible). { document[image_name].width = w; document[image_name].height = h; } function na_break_frame() // Break Frame // body // // Prevents the current page from opening in a frame. Opens only in the whole browser window. { if (window != top) top.location.href = location.href; } function na_two_frame(fname1, url1, fname2, url2) // Update Two Frames // img, a, select, button, timeline, layer // 'Frame 1' TEXT, 'URL1' FILE htm html, 'Frame 2' TEXT, 'URL 2' FILE htm html // Updates the contents of two frames at once. { parent[fname1].location.href = url1; parent[fname2].location.href = url2; } function na_three_frame(fname1, url1, fname2, url2, fname3, url3) // Update Three Frames // img, a, select, button, timeline, layer // 'Frame 1' TEXT, 'URL 1' FILE htm html, 'Frame 2' TEXT, 'URL 2' FILE htm html, 'Frame 3' TEXT, 'URL 3' FILE htm html // Updates the contents of three frames at once. { parent[fname1].location.href = url1; parent[fname2].location.href = url2; parent[fname3].location.href = url3; } function na_parent_frame(url) // Merge Frames // img, a, select, button, timeline, layer // 'URL' FILE htm html // Opens a new URL in the current window without frames. { parent.location.href = url; } function na_resize_by_win(offsetXPx, offsetYPx, oj) // Resize Window by // img, a, select, button, timeline, layer // 'Offset X' NUM 200, 'Offset Y' NUM 200 // Resizes Window by the amount of value you specify. { if (document.layers || document.all) { if (!oj) oj = self oj.resizeBy (offsetXPx, offsetYPx) if (document.layers) oj.location.reload(0) } } function na_resize_to_win(widthPx, heightPx, oj) // Resize Window to // img, a, select, button, timeline, layer // 'Width' NUM 500, 'Height' NUM 500 // Resizes window to the size you specify. { if(document.all) { var nw = navigator.userAgent.indexOf('Win') var nm = navigator.userAgent.indexOf('Mac') var nu = navigator.userAgent.indexOf('X11') if (nw!=-1) { widthPx+=12;heightPx+=137} if (nm!=-1) { widthPx+=0;heightPx-=0} if (nu!=-1) { widthPx+=0;heightPx-=0} } if(document.layers || document.all) { if (!oj) oj = self oj.resizeTo(widthPx, heightPx) if (nm!=-1) oj.location.reload(0) } } function na_delay_url(url, delay_sec) // Open URL After Delay // body, img, a, select, button, timeline, layer // 'URL' FILE htm html, 'Delay Time (Second)' NUM 3 // Moves to a new URL after a delay time that you specify. { setTimeout("top.location.href = '" + url + "'", delay_sec*1000); } function na_must_visit(visit_site, must_visit_site) // Open Sponsor Window // img, a, select, button, layer // 'Target URL' FILE htm html , 'Sponsor URL' FILE htm html // Opens an additional window that you want the visitor to visit. { window.open(must_visit_site); window.location = visit_site; } function na_full_win(url) // Open Full Window // body, img, a, select, button, timeline, layer // 'URL' FILE htm html // Opens a full screen window without toolbars, status bar, or anything else attached. { window.open (url,"", "fullscreen, scrollbars") } function na_shake_window(n) // Shake Windows // body, img, a, select, button, layer // 'Number of Shaking Times' NUM 5 // Shakes the window as many times as you specify. { netscape = (navigator.appName == "Netscape"); n4 = netscape && (parseInt(navigator.appVersion) >= 4); explorer = (navigator.appName == "Microsoft Internet Explorer"); ie4 = explorer && (parseInt(navigator.appVersion) >= 4); if (n4 || ie4) { for (i = 10; i > 0; i--) { for (j = n; j > 0; j--) { self.moveBy(0,i); self.moveBy(i,0); self.moveBy(0,-i); self.moveBy(-i,0); } } } } function na_scroll_window(n, dir) // Scroll Page // body, img, a, button, layer // 'Length (Pixel)' NUM 200, 'Direction' NUMCOMBO 'Up' 'Down' // Scrolls the web page by the amount you specify. { var n; var dir; if (dir == 1) { for (i = 1; i <= n; i++) parent.scroll(1,i); } else if (dir == 0) { for (i = n; i >= 1; i--) { parent.scroll(n,i); } } } function na_window_close() // Close Window // body, img, a, select, button, timeline, layer // // Closes the current window. { window.close(); } function na_animate_win_open(windowWidth, windowHeight, targetWidth, targetHeight, widthMod, heightMod) // Spreading Window // body // 'Initial Width' NUM 10, 'Initial Height' NUM 10, 'Target Width' NUM 400, 'Target Height' NUM 400, 'Width Speed' NUM 2, 'Height Speed' NUM 2 // Opens the window by gradually enlarging the window size. { if (windowWidth < targetWidth) windowWidth += widthMod; if (windowHeight < targetHeight) windowHeight += heightMod; windowLeft = (screen.availWidth / 2) - (windowWidth / 2); windowTop = (screen.availHeight / 2) - (windowHeight / 2); top.window.resizeTo(windowWidth,windowHeight); top.window.moveTo(windowLeft, windowTop); if (windowWidth < targetWidth || windowHeight < targetHeight) setTimeout('na_animate_win_open(' + windowWidth + ', ' + windowHeight + ', ' + targetWidth + ', ' + targetHeight + ', ' + widthMod + ', ' + heightMod + ');',10); } function na_note_window (title, width, height, message, colorBack, back, textColor, typeFont, sizeFont) // Open Message Window // img, a, layer // 'Title' TEXT, 'Width' NUM 400, 'Height' NUM 400, 'Message' TEXT, 'Background Color' COLOR #FFFFFF, 'BackgroundImage' FILE, 'Text Color' COLOR #000000, 'Font' FONT, 'Font Size (pt)' NUM 12 // Pops up a window that contains message with style. { windowNote = window.open('','Note','toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,' + 'width='+width+'' + ',height='+height+''); text = '<' + 'HTML' + '><' + 'HEAD' + '><' + 'TITLE' + '>' + title + '</' + 'TITLE' + '><' + '/HEAD' + '><' + 'BODY BACKGROUND=' + '"' + back + '"' + ' BGCOLOR=' + '"' + colorBack + '">'; text += '<CENTER>'; text += '<span style= "font-size:' +sizeFont+ 'pt;">'; text +='<FONT FACE="' + typeFont +'"'; text += ' COLOR=' + '"' + textColor +'">'; text += message + '</CENTER></FONT>'; text += '</span>'; text += '</' + 'BODY' + '><' + '/HTML' + '>'; windowNote.document.write(text); windowNote.focus(); windowNote.document.close(); return false; } function na_reload_win() // Reload Window // img, a, select, button, layer // // Reloads the current page { document.location.reload() } function na_reload_intervals(na_re_sec) // Reload at intervals // body // 'Intervals (Second)' NUM 5 // Reloads the current page at specified intervals. { setTimeout("history.go(0)", na_re_sec*1000); } function na_redirect_alert(str, url) // Redirect with Alert Message // body, img, a, select, button, layer // 'Message' TEXT, 'URL' FILE htm html // Redirects the visitor to a new URL with an alert message. { alert(str); location = url; } function na_change_location(url) // Change URL of Window // img, a, select, button, timeline, layer // 'URL' FILE htm html // Moves to a new URL without opening a new window { location=url; } function na_redirect_by_resolution(url_640x480, url_800x600, url_1024x768, other) // Redirect By Screen Resolution // body // '640x480' FILE htm html,'800x600' FILE htm html, '1024x768' FILE htm html, 'Other' FILE htm html // Redirects the visitor according to the screen resolution { var url_640x480; var url_800x600; var url_1024x768; if (screen.width==640||screen.height==480) window.location.replace(url_640x480) else if (screen.width == 800 ||screen.height == 600) window.location.replace(url_800x600); else if (screen.width == 1024||screen.height == 768) window.location.replace(url_1024x768); else window.location.replace(other); } function na_os_sniffer(macURL, linuxURL, winURL) // Redirect by Operating System // body // 'MacURL' FILE htm html, 'LinuxURL' FILE htm html, 'WinURL' FILE htm html // Redirects the visitor according to the operating system { var agt = navigator.userAgent.toLowerCase(); var is_major = parseInt(navigator.appVersion); var is_minor = parseFloat(navigator.appVersion); var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible')== -1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1)); var is_mac = (agt.indexOf("mac")!=-1); var is_linux = (agt.indexOf("linux")!=-1); var is_win = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) ); var is_win95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1)); var is_win16 = ((agt.indexOf("win16")!=-1) || (agt.indexOf("16bit")!=-1) || (agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("windows 16-bit")!=-1) ); var is_win31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) || (agt.indexOf("windows 16-bit")!=-1)); var is_win98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1)); var is_winnt = ((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1)); var is_win32 = (is_win95 || is_winnt || is_win98 || ((is_major >= 4) && (navigator.platform == "Win32")) || (agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1)); if (is_mac) { location.href = macURL; } else if (is_linux) { location.href = linuxURL; } else if (is_win || is_win95 || is_win98 || is_winnt || is_win31 || is_win32 || is_win16) { location.href = winURL; } } function na_rotate_window(r, number, x_value, y_value) // Rotate Window // body // 'Radius' NUM 20, 'Number of Rotation' NUM 3, 'Offset X' NUM, 'Offset Y' NUM // Rotates the window, and places the window to the position you specify in the end. { for ( var i = 0; i < number*360; i++) { x = (r * Math.cos((i * Math.PI)/180)) + x_value; y = (r * Math.sin((i * Math.PI)/180)) + y_value; self.moveTo(x,y); } } function na_email_validation(fname, type_name, str) // Validate Email // text // 'Form Name' FORM, 'Form Field Name' FORMFIELD, 'Message' TEXT // Checks if the e-mail is valid. { var email_validation = true var temp = document.forms[fname].elements[type_name] var at = temp.value.indexOf('@') var prd = temp.value.lastIndexOf('.') var space = temp.value.indexOf(' ') var length = temp.value.length - 1 if ((at < 1) || (prd <= at+1) || (prd == length ) || (space != -1)) { email_validation = false alert(str) temp.focus() } return email_validation } function na_null_validate(fname, tname, str) // Null Validation of Form Field // text // 'Form Name' FORM, 'Form Field Name' FORMFIELD, 'Message' TEXT // Check whether a specific text form field is blank or not. { f_name = document[fname] elemnt_name = f_name[tname].value if (elemnt_name == "") { alert(str) return false } } function na_number_validate (fname, type_name, str) // Number Validation // text // 'Form Name' FORM, 'Form Field Name' FORMFIELD, 'Message' TEXT // Checks whether the value in the text field is number or not. { num_Val = document.forms[fname].elements[type_name].value var numStr = "0123456789"; var thisChar; var counter = 0; for (var n = 0; n < num_Val.length; n++) { thisChar = num_Val.substring(n, n+1); if (numStr.indexOf(thisChar) != -1) counter ++; } if (counter == num_Val.length) return true; else alert(str); return false; } function na_check_max_length(fname, type_name, str, maxlength) // Restrict Text Length // text // 'Form Name' FORM, 'Form Field Name' FORMFIELD, 'Message' TEXT, 'Max Length' NUM 5 // Restricts the number of characters in the text form field. { var maxlength; if (document.forms[fname].elements[type_name].value.length > maxlength) { alert(str); return false } } function na_set_focus(form_name, type_name) // Move Focus to // body, text // 'Form Name' FORM, 'Form Field Name' FORMFIELD // Moves the focus to the form field you specify. { document[form_name][type_name].focus() } function na_form_clear(fname, type_name) // Reset Form Field // select, text, textarea // 'Form Name' FORM, 'Form Field Name' FORMFIELD // Clears the specific text form field. { if (document.forms[fname].elements[type_name].value = document.forms[fname].elements[type_name].defaultValue) { document.forms[fname].elements[type_name].value = ""; } } function na_form_validation(fname ,str) // Validate Form // text, button // 'Form Name' FORM, 'Message' TEXT // Validates if the text field values in the form are blank or not. { var x = 0 var form_validation = true while ((x < document.forms[fname].elements.length) && (form_validation) ) { if (document.forms[fname].elements[x].value == '') { alert(str) document.forms[fname].elements[x].focus() form_validation = false } x ++ } return form_validation } function na_select_form (fname, type_name) // Select Text // a, select, text, button, textarea // 'Form Name' FORM, 'Form Field Name' FORMFIELD // Selects the entire text entered in a specific text form field. { document.forms[fname].elements[type_name].select() document.forms[fname].elements[type_name].focus() } function na_custom_print() // Print Document // body, img, a, select, button, layer // // Print Document as if the browser's print button had been clicked. { if (document.all) { if (navigator.appVersion.indexOf("5.0") == -1) { var OLECMDID_PRINT = 6; var OLECMDEXECOPT_DONTPROMPTUSER = 2; var OLECMDEXECOPT_PROMPTUSER = 1; var WebBrowser = "<OBJECT ID=\"WebBrowser1\" WIDTH=0 HEIGHT=0 CLASSID=\"CLSID:8856F961-340A-11D0-A96B-00C04FD705A2\"></OBJECT>"; document.body.insertAdjacentHTML("beforeEnd", WebBrowser); WebBrowser1.ExecWB(6, 2); WebBrowser1.outerHTML = ""; } else { self.print(); } } else { self.print(); } } function na_no_right_click(message) // Prevent Right-click // body // 'Message' TEXT // Prevents right-mouse click event from functioning. { var message; function click(e) { if (document.all) { if (event.button == 2) { alert(message); return false; } } if (document.layers) { if (e.which == 3) { alert(message); return false; } } } if (document.layers) { document.captureEvents(Event.MOUSEDOWN); } document.onmousedown= click; } function na_change_bgcolor(color) // Set Background Color // img, a, select, button, timeline, layer // 'Color' COLOR #FFFFFF // Sets the background color of the document. { document.bgColor=color; } function na_bground_img_change(img) // Set Background Image // img, a, select, button, timeline, layer // 'Image' FILE // Sets the background image of the document (Internet Explorer Compatible). { var img; if (navigator.appName=="Microsoft Internet Explorer") { document.body.background=img; } } function na_windows_media_play(id) // Play Windows Media Player // img, a, select, button, layer // 'ID' TEXT MediaPlayer1 // Plays Windows Media Player embedded in Document (Internet Explorer Compatible). { document.all[id].play() } function na_windows_media_stop(id) // Stop Windows Media Player // img, a, select, button, layer // 'ID' TEXT MediaPlayer1 // Stops Windows Media Player embedded in Document (Internet Explorer Compatible). { document.all[id].stop() } function na_windows_media_pause(id) // Pause Windows Media Player // img, a, select, button, layer // 'ID' TEXT MediaPlayer1 // Pauses Windows Media Player embedded in Document (Internet Explorer Compatible). { document.all[id].pause() } function na_last_update(lname, color, size, font, style, weight) // Write Last Update Information to Layer // body // 'Target Layer' LAYER, 'Font Color' COLOR #000000, 'Font Size (pt)' NUM 12, 'Font' FONT, 'Font Style' TEXTCOMBO 'normal' 'italic' 'oblique', 'Font Weight' TEXTCOMBO 'normal' 'bold' 'bolder' 'lighter' 100 200 300 400 500 600 700 800 900 // Displays the last update information in the layer you specify. { var str =document.lastModified; if (document.layers) { with(document.layers[lname]) { document.open() document.write(str) document.fgColor = color document.close(); } } if (document.all) { document.all(lname).style.color = color document.all(lname).style.fontSize = size document.all(lname).style.fontFamily = font document.all(lname).style.fontStyle = style document.all(lname).style.fontWeight = weight document.all(lname).innerHTML = str } } function na_blink(speed) // Blink Effect // body // 'Frequency' NUM 2 // Makes the window blink at a specific speed. { if (speed) { if (document.all) setInterval("na_blink()", speed*1000) return; } var blink = document.all.tags("BLINK") for (var i=0; i<blink.length; i++) blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : "" } function na_object_show(obj) // Show Object // img, a, select, button, timeline, layer // 'Object ID' TEXT // Makes the specified object visible (Internet Explorer Compatible). { if(document.layers) document.layers[obj].visibility = 'show' if(document.all) document.all(obj).style.visibility = 'visible' } function na_object_hide(obj) // Hide Object // img, a, select, button, timeline, layer // 'Object ID' TEXT // Makes the specified object invisible (Internet Explorer Compatible). { if(document.layers) document.layers[obj].visibility ='hide' if(document.all) document.all(obj).style.visibility ='hidden' } function na_remove_filter(lname) // Remove Filter Effect // img, a, select, button, timeline, layer // 'Target Layer' LAYER // Removes the filter effect applied to the specific object (Internet Explorer Compatible). { document.all[lname].style.filter=" " } function na_alpha_filter(lname, f_style, f_opacity, f_f_opacity, f_startx, f_starty, f_finishx, f_finishy) // Apply Alpha Effect // body, img, a, select, button, timeline, layer // 'Target Layer' LAYER, 'Style' NUMCOMBO '0 - Uniform' '1 - Linear' '2 - Radial' '3 - Rectangular', 'Opacity' NUM 100, 'Finish Opacity' NUM 0, 'Start X' NUM 0, 'Start Y' NUM 0, 'Finish X' NUM 100, 'Finish Y' NUM 100 // Sets the opactiy of a specific object (Internet Explorer5.5 Compatible). { document.all[lname].style.filter="alpha(style ="+f_style+", opacity="+f_opacity+", finishopacity="+f_f_opacity+", startx ="+f_startx+", starty ="+f_starty+", finishx ="+f_finishx+", finishy ="+f_finishy+")" } function na_blur_filter(lname, f_PixelRadius, f_MakeShadow, f_ShadowOpacity_value) // Apply Blur Effect // body, img, a, select, button, timeline, layer // 'Target Layer' LAYER, 'Pixel Radius' NUM 2, 'Make Shadow' BOOL, 'Shadow Opacity (%)' NUM 50 // Controls the blurriness of a specific object (Internet Explorer5.5 Compatible). { var f_ShadowOpacity = f_ShadowOpacity_value/100; if (f_MakeShadow == false) { document.all[lname].style.filter="progid:DXImageTransform.Microsoft.blur(PixelRadius="+f_PixelRadius+", MakeShadow=false)" } else if (f_MakeShadow == true) { document.all[lname].style.filter="progid:DXImageTransform.Microsoft.blur(PixelRadius="+f_PixelRadius+", MakeShadow=true, ShadowOpacity="+f_ShadowOpacity+")" } } function na_chroma(lname, f_color) // Apply Chroma Effect // body, img, a, select, button, timeline, layer // 'Target Layer' LAYER, 'Color' COLOR #CCCCCC // Changes a specific color within an object transparent (Internet Explorer5.5 Compatible). { document.all[lname].style.filter="chroma(color="+f_color+")" } function na_dropshadow(lname , f_color, f_offx, f_offy, f_positive) // Apply Dropshadow Effect // body, img, a, select, button, timeline, layer // 'Target Layer' LAYER, 'Color' COLOR #CCCCCC, 'Offset X' NUM 5, 'Offset Y' NUM 5 // Applies a shadow that makes an object look floated (Internet Explorer5.5 Compatible). { document.all[lname].style.filter="dropshadow(color="+f_color+", offx ="+f_offx+", offy ="+f_offy+", positive ="+f_positive+")" } function na_fliph_filter(lname) // Apply Fliph Effect // body, img, a, select, button, timeline, layer // 'Target Layer' LAYER // Creates a horizontal mirror image effect of the object (Internet Explorer5.5 Compatible). { document.all[lname].style.filter="fliph" } function na_flipv_filter(lname) // Apply Flipv Effect // body, img, a, select, button, timeline, layer // 'Target Layer' LAYER // Creates a vertical mirror image effect of the object (Internet Explorer5.5 Compatible). { document.all[lname].style.filter="flipv" } function na_glow_filter(lname, f_color, f_strength) // Apply Glow Effect // body, img, a, select, button, timeline, layer // 'Target Layer' LAYER, 'Color' COLOR #CCCCCC, 'Strength' NUM 5 // Makes a glow around the object (Internet Explorer5.5 Compatible). { document.all[lname].style.filter="glow(color="+f_color+", strength ="+f_strength+")" } function na_gray_filter(lname) // Apply Gray Effect // body, img, a, select, button, timeline, layer // 'Target Layer' LAYER // Changes an object to monochromatic colors (Internet Explorer5.5 Compatible). { document.all[lname].style.filter="gray" } function na_invert_filter(lname) // Apply Invert Effect // body, img, a, select, button, timeline, layer // 'Target Layer' LAYER // Reverses all hue, saturation and brightness values of an object (Internet Explorer5.5 Compatible). { document.all[lname].style.filter="invert" } function na_mask_filter(lname, f_color) // Apply Mask Effect // body, img, a, select, button, timeline, layer // 'Target Layer' LAYER, 'Color' COLOR #CCCCCC // Displays transparent part of the object as a color mask, and makes the nontransparent part transparent (Internet Explorer5.5 Compatible). { document.all[lname].style.filter="progid:DXImageTransform.Microsoft.MaskFilter(color="+f_color+")" } function na_motionblur_filter(lname, f_direction, f_strength) // Apply Motionblur Effect // body, img, a, select, button, timeline, layer // 'Target Layer' LAYER, 'Direction' NUM 270, 'Strength' NUM 5 // Causes the content of the object to appear to be in motion (Internet Explorer5.5 Compatible). { document.all[lname].style.filter="blur(direction ="+f_direction+", strength ="+f_strength+")" } function na_shadow_filter(lname, f_color, f_direction) // Apply Shadow Effect // body, img, a, select, button, timeline, layer // 'Target Layer' LAYER, 'Color' COLOR #CCCCCC, 'Direction' NUM 270 // Applies shadow to an object (Internet Explorer5.5 Compatible). { document.all[lname].style.filter="shadow(color="+f_color+", direction ="+f_direction+")" } function na_wave_filter(lname, f_add, f_freq, f_lightstrength, f_phase, f_strength) // Apply Wave Effect // body, img, a, select, button, timeline, layer // 'Target Layer' LAYER, 'Add' BOOL, 'Freq' NUM 3, 'Light Strength' NUM 100, 'Phase' NUM 0, 'Strength' NUM 5 // Performs a sine wave distortion of the content of the object along the vertical axis (Internet Explorer5.5 Compatible). { var f_add_value; if (f_add == true) { f_add_value = 'true' } else if (f_add == false) { f_add_value = 'false' } document.all[lname].style.filter="progid:DXImageTransform.Microsoft.Wave(Add ="+f_add_value+", Freq="+f_freq+", LightStrength="+f_lightstrength+", Phase ="+f_phase+", Strength ="+f_strength+")" } function na_xray_filter(lname) // Apply Xray Effect // body, img, a, select, button, timeline, layer // 'Target Layer' LAYER // Shows outline of an object (Internet Explorer5.5 Compatible). { document.all[lname].style.filter="xray" } function na_erase_statusbar(msg, er_speed) // Erasing Status Bar // body // 'Message' TEXT, 'Intervals (millisecond)' NUM 50 // Creates a text animation effect erasing at intervals in a status bar. { if (!document.na_erasestr) { document.na_erasestr = msg; document.comeback = 0 document.cometo = 0 document.er_spd = er_speed } window.status = document.na_erasestr.substring(0, document.cometo) if(document.comeback == 1) { document.cometo--; if(document.cometo==0) { document.comeback=0 } } else { document.cometo++; if (document.cometo == document.na_erasestr.length) { document.comeback = 1 } } window.status = document.na_erasestr.substring(0, document.cometo)+"|" if(document.cometo == document.na_erasestr.length) { window.setTimeout("na_erase_statusbar()", document.er_spd); } else { window.setTimeout("na_erase_statusbar()", document.er_spd/10); } } function na_flash_status(str, fla_speed) // Flashing Status Bar // body // 'Message' TEXT, 'Intervals (millisecond)' NUM 50 // Creates a text animation effect flashing at intervals in a status bar. { if(!document.str) { document.str = str; document.temp=1; document.fla_spd = fla_speed } if (document.temp == 1) { window.status =document.str; document.temp=0; } else { window.status = ""; document.temp=1; } setTimeout("na_flash_status()", document.fla_spd); } function na_shoot_message(msg, sho_speed) // Shooting Status Bar // body // 'Message' TEXT, 'Intervals (millisecond)' NUM 50 // Creates a text animation effect shooting texts at intervals in a status bar. { if(!document.na_shoot_str) { document.na_shoot_str = ""; document.na_shoot_init_msg =msg+" "; document.na_shoot_msg = "" document.na_shoot_leftmsg = "" document.sho_spd = sho_speed } if (document.na_shoot_msg == "") { document.na_shoot_str = " " document.na_shoot_msg = document.na_shoot_init_msg document.na_shoot_leftmsg = "" } if (document.na_shoot_str.length == 1) { while (document.na_shoot_msg.substring(0, 1) == " ") { document.na_shoot_leftmsg = document.na_shoot_leftmsg + document.na_shoot_str document.na_shoot_str = document.na_shoot_msg.substring(0, 1) document.na_shoot_msg = document.na_shoot_msg.substring(1, document.na_shoot_msg.length) } document.na_shoot_leftmsg = document.na_shoot_leftmsg + document.na_shoot_str document.na_shoot_str = document.na_shoot_msg.substring(0, 1) document.na_shoot_msg = document.na_shoot_msg.substring(1, document.na_shoot_msg.length) for (var ii = 0; ii < 120; ii++) { document.na_shoot_str = " " + document.na_shoot_str } } else { document.na_shoot_str = document.na_shoot_str.substring(4, document.na_shoot_str.length) } window.status = document.na_shoot_leftmsg + document.na_shoot_str setTimeout('na_shoot_message()', document.sho_spd) }